package com.jsu.clubmanagementsystem.model.vo.userApplication;


import com.jsu.clubmanagementsystem.model.entity.UserApplication;
import com.jsu.clubmanagementsystem.model.vo.review.ReviewVO;
import com.jsu.clubmanagementsystem.model.vo.user.UserVO;
import lombok.Data;
import org.springframework.beans.BeanUtils;

import java.io.Serializable;
import java.util.Date;

@Data
public class UserApplicationVO implements Serializable {
    /**
     * id
     */
    private Long id;

    /**
     * 申请用户id
     */
    private UserVO userVO;

    /**
     * 申请目标的名称（社团名/活动名）
     */
    private String targetName;

    /**
     * 申请原因
     */
    private String reason;

    /**
     * 创建时间
     */
    private Date createTime;

    /**
     * 审核结果
     */
    private ReviewVO reviewVO;

    /**
     * 申请类型: 0-账号注销, 1-加入社团, 2-退出社团, 3-参与活动, 4-退出活动
     */
    private Integer type;

    /**
     * 附加值: 社团id/活动id/用户id
     */
    private Long additionalInfo;

    private static final long serialVersionUID = 1L;

    public static UserApplicationVO objToVo(UserApplication application) {
        UserApplicationVO applicationVO = new UserApplicationVO();
        BeanUtils.copyProperties(application, applicationVO);
        return applicationVO;
    }
}
